# -*- coding: utf-8 -*-

import xlrd
import io
import mysettings

excel_file = xlrd.open_workbook(mysettings._EXCEL_FILE_PATH_)

sheets = excel_file.sheets()

for sheet in sheets:
    for i in range(1, sheet.nrows):
       sql = mysettings._SQL_FORMAT_
       for j in range(sheet.ncols):
           val = sheet.cell(i, j).value
           v = mysettings.GetVal(j+1, val)
           sql = sql.replace("${" + str(j + 1) + "}", str(v))
       print(sql)

